import java.io.FileInputStream;
import java.io.IOException;

public class FileInputStreamDemo
{
    public static void main(String[] args)
    {
        // file的输入流  从文件中读书字节流  然后处理
        String path = "src/news1.txt";
        FileInputStream stream = null;
        byte[] text = new byte[128];
        int readLen = 0;
        try
        {
            stream = new FileInputStream(path);
            while ((readLen = stream.read(text)) != -1)
            {
//                System.out.println(new String(text,0,readLen));
                for (int i = 0 ; i < readLen ; i++)
                {
                    if( text[i] >= 97 && text[i] <= 122)
                    {
                        text[i] -= 32;
                    }
                }
                System.out.println(new String(text,0,readLen));
            }
        }catch (IOException e)
        {
            e.printStackTrace();
        }
        finally
        {
            try
            {
                stream.close();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }
    }
}
